package net.oschina.app.util;

import android.databinding.BindingAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;

/**
 * Created by YL on 2017/4/5.
 */

public class BindingUtils {
    @BindingAdapter("image")
    public static void imageLoader(ImageView imageView, String url) {
        Glide.with(imageView.getContext()).load(url).override(UIUtils.dip2Px(50), UIUtils.dip2Px(50)).into(imageView);
        //widget_dface
    }

    @BindingAdapter("objecttype")
    public static void typeLoader(TextView tv, String url) {
        if ("100".equals(url)) {
            tv.setText("更新了动态");
        } else if ("101".equals(url)) {
            tv.setText("回复了动态:");
        }
    }
}
